<?php

class Util{

	function ShortenString($text, $size) {
		// Change to the number of characters you want to display
		if (strlen($text) > $size){
			$text = substr($text,0, $size);
			$text = $text."...";
		}

		return $text;
	}


	function getPercentage($numerator, $denominator){
		if (($numerator == 0) && ($denominator == 0)){
			return -1;
		} else {
			return round(($numerator/$denominator)* 100);
		}
	}
}

?>